package model

type Remark struct {
	Code    string `json:"code"`
	Name    string `json:"name"`
	Unit    string `json:"unit"`
	SkuName string `json:"sku_name,omitempty"`
}

// 实时库存remark格式，类别按ID记录，实时从数据库或外部系统查看
type StorageRealTimeRemark struct {
	Remark
	Type          uint32  `json:"type_id"`
	StorageUnit   string  `json:"storage_unit"`
	StorageRatio  float64 `json:"storage_ratio"`
	PurchaseUnit  string  `json:"purchase_unit"`
	PurchaseRatio float64 `json:"purchase_ratio"`
}

// 快照remark模式，类别按名称记录，直接返回展示
type SnapShotRemark struct {
	Remark
	Type string `json:"type"`
}

type OperationDetailRemark struct {
	Remark
	Reason string `json:"reason"`
}

// 用于数据库加载通用模型
type FullRemark struct {
	SnapShotRemark
	StorageUnit   string  `json:"storage_unit"`
	StorageRatio  float64 `json:"storage_ratio"`
	PurchaseUnit  string  `json:"purchase_unit"`
	PurchaseRatio float64 `json:"purchase_ratio"`
	// 这里用于新建实时库存
	TypeID   uint32 `json:"type_id"`
	PStoreID uint32 `json:"p_store_id"`
}

// 库存模式明细快照
type StorageSnapShotRemark struct {
	SnapShotRemark
	StorageUnit  string  `json:"storage_unit"`
	StorageRatio float64 `json:"storage_ratio"`
}

// 采购模式明细快照
type PurchaseSnapShotRemark struct {
	SnapShotRemark
	PurchaseUnit  string  `json:"purchase_unit"`
	PurchaseRatio float64 `json:"purchase_ratio"`
}

// 损耗明细，需要包含备注
type LossSnapShotRemark struct {
	StorageSnapShotRemark
	Memo string `json:"memo"`
}

// 履约单备注
type ProcessOrderRemark struct {
	Memo       string `json:"memo,omitempty"`
	Reason     string `json:"reason,omitempty"`
	ExtractKey string `json:"extract_key,omitempty"`
}
